<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
    <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8" />
    <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
    <title>PHProjekt</title>
    <link rel="favicon" href="img/favicon.ico" />
    <link rel="shortcut icon" href="img/favicon.ico" />
    <link href="min/min/?g=phprojekt" rel="stylesheet" type="text/css" />

    <script type="text/javascript">
        var djConfig = {isDebug: false, parseOnLoad: true, bindEncoding: "utf-8",
                        locale: '<?php echo $this->language; ?>'};
    </script>
    <?php
    if (true === $this->isLoggedIn) {
        if ($this->compressedDojo) {
        ?>
            <script type="text/javascript" src="dojo/release/dojo/dojo/dojo.js"></script>
            <script type="text/javascript" src="dojo/release/dojo/dojo/phprojekt.js"></script>
        <?php
        } else {
        ?>
            <script type="text/javascript" src="dojo/release/dojo/dojo/dojo.js.uncompressed.js"></script>
            <script type="text/javascript" src="dojo/release/dojo/dojo/phprojekt.js.uncompressed.js"></script>
        <?php
        }
        ?>
        <script type="text/javascript"
            src="index.php/js/index/csrfToken/<?php echo Phprojekt::createCsrfToken(); ?>">
        </script>
    <?php
    } else {
    ?>
        <script type="text/javascript" src="dojo/release/dojo/dojo/dojo.js"></script>
        <script type="text/javascript" src="dojo/release/dojo/dojo/login.js"></script>
        <script type="text/javascript">
            dojo.require("dojo.parser");
            dojo.require("dijit.layout.BorderContainer");
            dojo.require("dijit.layout.ContentPane");
            dojo.require("dijit.Toolbar");
            dojo.require("dijit.form.Form");
            dojo.require("dijit.form.TextBox");
            dojo.require("dijit.form.CheckBox");
        </script>
    <?php
    }
    ?>
    <?php
        if (true !== $this->isLoggedIn) {
    ?>
    <script type="text/javascript">
        // This variable is needed to be able to clear an existing interval.
        dojo.addOnLoad(function() {
                dojo.byId('hash').value = <?php
                if ($this->hash) {
                    echo '"' . $this->hash . '"';
                } else {
                    echo 'window.location.hash';
                }
                ?>;
                dojo.byId('username').focus();
                dojo.byId('username').select();
        });
    </script>
    <?php
        }
    ?>
</head>
<body class="phprojekt claro">
    <?php
    if (true === $this->isLoggedIn) {
    ?>
    <script type="text/javascript">
        dojo.addOnLoad(function() {
            var main = new phpr.Main(1, '<?php echo $this->language; ?>');
            <?php
            if ($this->frontendMsg) {
            ?>
                phpr.frontendMessage.startLoop(<?php echo $this->pollingLoop; ?>);
            <?php
            }
            ?>
        });
    </script>
    <?php
    } else {
        include ("login.phtml");
    }
    ?>
</body>
</html>
<!-- template: index.phml -->
